package com.ruoyi.core.service.impl;

import java.util.Arrays;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.entity.CoreEntity.store.StoreBusinessTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.core.mapper.StoreBusinessTimeMapper;

import com.ruoyi.core.service.IStoreBusinessTimeService;

/**
 * 门店营业时间配置Service业务层处理
 * 
 * @author Sxz
 * @date 2025-08-07
 */
@Service
public class StoreBusinessTimeServiceImpl implements IStoreBusinessTimeService 
{
    @Autowired
    private StoreBusinessTimeMapper storeBusinessTimeMapper;

    /**
     * 查询门店营业时间配置
     * 
     * @param id 门店营业时间配置主键
     * @return 门店营业时间配置
     */
    @Override
    public StoreBusinessTime selectStoreBusinessTimeById(Long id)
    {
        return storeBusinessTimeMapper.selectStoreBusinessTimeById(id);
    }

    /**
     * 查询门店营业时间配置列表
     * 
     * @param storeBusinessTime 门店营业时间配置
     * @return 门店营业时间配置
     */
    @Override
    public List<StoreBusinessTime> selectStoreBusinessTimeList(StoreBusinessTime storeBusinessTime)
    {
        return storeBusinessTimeMapper.selectStoreBusinessTimeList(storeBusinessTime);
    }

    /**
     * 新增门店营业时间配置
     * 
     * @param storeBusinessTime 门店营业时间配置
     * @return 结果
     */
    @Override
    public int insertStoreBusinessTime(StoreBusinessTime storeBusinessTime)
    {
        storeBusinessTime.setCreateTime(DateUtils.getNowDate());
        return storeBusinessTimeMapper.insertStoreBusinessTime(storeBusinessTime);
    }

    /**
     * 修改门店营业时间配置
     * 
     * @param storeBusinessTime 门店营业时间配置
     * @return 结果
     */
    @Override
    public int updateStoreBusinessTime(StoreBusinessTime storeBusinessTime)
    {
        return storeBusinessTimeMapper.updateStoreBusinessTime(storeBusinessTime);
    }

    /**
     * 批量删除门店营业时间配置
     * 
     * @param ids 需要删除的门店营业时间配置主键
     * @return 结果
     */
    @Override
    public int deleteStoreBusinessTimeByIds(Long[] ids)
    {
        return storeBusinessTimeMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除门店营业时间配置信息
     * 
     * @param id 门店营业时间配置主键
     * @return 结果
     */
    @Override
    public int deleteStoreBusinessTimeById(Long id)
    {
        return storeBusinessTimeMapper.deleteById(id);
    }
}
